package com.wudl.govern.mapper;

import com.wudl.govern.domain.TaskRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：wudl
 * @date ：Created in 2022-04-05 16:43
 * @description：
 * @modified By：
 * @version: 1.0
 */

@Mapper
public interface TaskRuleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TaskRule record);

    int insertSelective(TaskRule record);

    TaskRule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TaskRule record);

    int updateByPrimaryKey(TaskRule record);

    /**
     * 物理删除任务和规则的关系
     * @author qunan
     * @date 2018/12/6
     * @param taskId
     * @return
     */
    int deleteRelation(@Param("taskId") Integer taskId);

    /**
     * 添加任务和规则的关系
     * @author qunan
     * @date 2018/12/6
     * @param taskRuleList
     * @return
     */
    int addRelation(List<TaskRule> taskRuleList);

    /**
     * 寻找任务所对应的规则id
     * @author qunan
     * @date 2018/12/6
     * @param taskId
     * @return
     */
    List<Integer> selectRuleTaskList(@Param("taskId") Integer taskId);

    /**
     * 逻辑删除
     * @author qunan
     * @date 2018/12/6
     * @param taskId
     * @return
     */
    int deleteById(@Param("taskId") Integer taskId);
}